#ifndef SHIP_H
#define SHIP_H

#include "math.h"
#include <iostream>
#include "Sprite.h"
#include "Bullet.h"

using namespace shapes;

namespace sprites 
{
	class Ship : public Sprite
	{
		Bullet* bullet;
		bool bulletShot;
		Vector3D moveRSpeed;
		float maxLeft;
		float maxRight;

	public:
		//constructors
	    Ship(Vector3D _pos, MatterType _type, float _boundRadius);
	    Ship(Vector3D _pos, MatterType _type, float _boundRadius, float scale);
	    ~Ship();

		//build animation
		void build();
		void buildBodyTop(ParentNode* _parent);
		void buildCannon(ParentNode* _parent);
		void buildTurret(ParentNode* _parent);

		//movement logic
		void moveLeft();
		void moveRight();

		//shooting logic
		Bullet* shoot();
		bool isShooting();
		
		//collision testing
		virtual BindingSphere getBindingSphere();
		virtual std::vector<BindingSphere> getBindingShapes();
		virtual void handleCollision(MatterType type, BindingSphere sphere);

		virtual void draw();

		void reset();
	};
}

#endif